package com.ruoyi.manufacturer.service.impl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.manufacturer.domain.DjManufacturer;
import com.ruoyi.manufacturer.mapper.DjManufacturerMapper;
import com.ruoyi.manufacturer.service.DjManufacturerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DjManufacturerServiceImpl implements DjManufacturerService {
    @Autowired
    private DjManufacturerMapper djManufacturerMapper;

    /**
     * 查询生产商管理
     *
     * @param manufacturerId 生产商管理ID
     * @return 生产商管理
     */
    @Override
    public DjManufacturer selectDjManufacturerById(Long manufacturerId)
    {
        return djManufacturerMapper.selectDjManufacturerById(manufacturerId);
    }

    /**
     * 查询生产商管理列表
     *
     * @param djManufacturer 生产商管理
     * @return 生产商管理
     */
    @Override
    public List<DjManufacturer> selectDjManufacturerList(DjManufacturer djManufacturer)
    {
        return djManufacturerMapper.selectDjManufacturerList(djManufacturer);
    }

    /**
     * 新增生产商管理
     *
     * @param djManufacturer 生产商管理
     * @return 结果
     */
    @Override
    public int insertDjManufacturer(DjManufacturer djManufacturer)
    {
        djManufacturer.setCreatTime(DateUtils.getNowDate());
        return djManufacturerMapper.insertDjManufacturer(djManufacturer);
    }

    /**
     * 修改生产商管理
     *
     * @param djManufacturer 生产商管理
     * @return 结果
     */
    @Override
    public int updateDjManufacturer(DjManufacturer djManufacturer)
    {
        djManufacturer.setUpdateTime(DateUtils.getNowDate());
        return djManufacturerMapper.updateDjManufacturer(djManufacturer);
    }

    /**
     * 删除生产商管理对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDjManufacturerByIds(String ids)
    {
        return djManufacturerMapper.deleteDjManufacturerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除生产商管理信息
     *
     * @param manufacturerId 生产商管理ID
     * @return 结果
     */
    @Override
    public int deleteDjManufacturerById(Long manufacturerId)
    {
        return djManufacturerMapper.deleteDjManufacturerById(manufacturerId);
    }

    /**
     * 查询所有生产商信息
     *
     * @return 结果
     */
    @Override
    public List<DjManufacturer> selectDjManufacturer() {
        return djManufacturerMapper.selectDjManufacturer();
    }
}
